<?php
	/**
	 * [Time]
	 * @Author   :seven
	 * @DateTime :2016-08-16T18:34:54+0800
	 * @Detail   :This Class Is The Example
	 */
	namespace Home\Util;
	
	class SendMsgUtil {

    static public function SetData($data,$type){
        $url = $data['url'];
		$openid = $data['openid'];
		$name = $data['name'];
		$time = date("Y-m-d H:i:s");
		$template_id = 'luO6uSW2XhWeHweQPh6EErxzugJ1HrN0e_j6aKzGtzo';
        if($type==0){
            $txt="申请司机";
            $txt2="申请成为司机";
        }else if($type==1){
            $txt="申请客服";
            $txt2="申请成为客服";
        }
		$template = array(
            'touser' => $openid,
            'template_id' => $template_id,
            'url' =>$url,
            'data' => array(
                'first' => array(
                    'value' => '您好，您有新的申请任务审核！',
                    'color' => "#173177"
                ),
                'keyword1' => array(
                    'value' => $name,
                    'color' => "#173177"
                ),
                'keyword2' => array(
                    'value' => $txt,
                    'color' => "#173177"
                ),
                'keyword3' => array(
                    'value' => $time,
                    'color' => "#173177"
                ),
                'keyword4' => array(
                    'value' => $txt2,
                    'color' => "#173177"
                ),
                'remark' => array(
                    'value' =>'请点击详情进行审核，谢谢。',
                    'color' => "#173177"
                )
            )
        );
		$SendMsg =  new \Util\WechatSendMsg('wxa61d5ad1056c9b66','3b3e14ecb756e155b82226dde95a138e');
		$SendMsg ->SendTplMsg(json_encode($template));
    }
}
	?>